<?php 
	function addtab( $path, $text ){
		echo "\t\t<a href=\"$path\"".(realpath($_SERVER['SCRIPT_FILENAME'])==realpath($path) ? ' id="selected"' : '').">$text</a>\n";
	}
?>
	
	<div id="header">
		<img alt="SnapStitcher" height="81" longdesc="SnapStitcherLogo" src="logo.png" width="426" />
	</div>
	
	<div class="search">
		<form name="search" action="gallery.php" method="GET">
			<input type="text" value="<?php echo htmlentities(stripslashes($_GET['terms']), ENT_QUOTES); ?>" name="terms" id="searchstr" <?php if(basename($_SERVER['SCRIPT_FILENAME']) == 'gallery.php') echo "onkeyup=\"filterScroller(document.getElementById('searchstr').value);\""; ?>/>
			<input type="submit" value="Search" style="display:none;" />
		</form>
	</div>
	
	<div class="tabs">
<?php
		addtab('index.php', 'Home');
		addtab('upload.php', 'Create');
		addtab('gallery.php', 'Gallery');
		addtab('about.php', 'About');
?>
	</div>
	
